#include <iostream>
#include <cmath>
using namespace std;
#define maxn 1001
const int INF = 1<<30;

int n, X, Y, Z;
int source[maxn], target[maxn];	//Position of A,B
int nSource=1, nTarget=1;		//0 is reserved as empty
int dp[maxn][maxn];

inline int tmin(int a, int b, int c){
	return min(min(a, b), c);
}

int main(){
	cin>>n>>X>>Y>>Z;
	for(int i=0; i<n; i++){
		int a,b;
		cin>>a>>b;
		while(a --> 0){ source[nSource++]=i; }
		while(b --> 0){ target[nTarget++]=i; }
	}
	
	for(int j=0; j<=nTarget; j++) dp[0][j]=j*X;	//source is empty
	for(int i=0; i<=nSource; i++) dp[i][0]=i*Y;	//target at empty
	
	for(int i=1; i<=nSource; i++){
		for(int j=1; j<=nTarget; j++){
			dp[i][j] = tmin(dp[i][j-1]+X, dp[i-1][j]+Y, dp[i-1][j-1]+Z*abs(source[i]-target[j]));
		}
	}
	
	cout<<dp[nSource][nTarget]<<endl;
	return 0;
}